package com.whc.gulimall.scekill.config;

import com.whc.gulimall.scekill.interceptor.SecKillInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author angaoen
 */
@Configuration
public class SecKillWebConfig implements WebMvcConfigurer {

    @Resource
    private SecKillInterceptor secKillInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(secKillInterceptor).addPathPatterns("/**");
    }
}
